package com.rustic.server.dto;

import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import com.rustic.server.dto.base.EventActivityBaseDTO;

import javax.validation.constraints.Max;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import org.hibernate.validator.constraints.Length;
import java.util.Date;

/**
 * 表[event_activity]对应UpdateDTO类
 *
 * @author auto
 */

@Data
@EqualsAndHashCode(callSuper = true)
public class EventActivityUpdateDTO extends EventActivityBaseDTO {
    /**
     * 自增ID
     */
    @NotNull(message = "id不能为空")
    @Min(value = 1, message = "id不能为空")
    @ApiModelProperty(value = "自增ID", dataType = "Integer")
    private Integer id;

    /**
     * 关联乡村id
     */
    @NotNull(message = "关联乡村不能为空")
    @Min(value = 1, message = "关联乡村不能为空")
    @ApiModelProperty(value = "关联乡村id", dataType = "int")
    private int rusticId;

    /**
     * 事件/活动
     */
    @NotEmpty(message = "事件/活动不能为空")
    @Length(min = 0, max = 100, message = "事件/活动长度为0-100个字符")
    @ApiModelProperty(value = "事件/活动", dataType = "String")
    private String name;

    /**
     * 地址
     */
    @NotEmpty(message = "地址不能为空")
    @Length(min = 0, max = 500, message = "地址长度为0-500个字符")
    @ApiModelProperty(value = "地址", dataType = "String")
    private String address;

    /**
     * 详细地址
     */
    @Length(min = 0, max = 500, message = "详细地址长度为0-500个字符")
    @ApiModelProperty(value = "详细地址", dataType = "String")
    private String detailedAddress;

    /**
     * 介绍
     */
    @NotEmpty(message = "介绍不能为空")
    @ApiModelProperty(value = "介绍", dataType = "String")
    private String introduce;

    /**
     * 封面
     */
    @NotEmpty(message = "封面不能为空")
    @Length(min = 0, max = 500, message = "封面长度为0-500个字符")
    @ApiModelProperty(value = "封面", dataType = "String")
    private String cover;

    /**
     * 图片(轮播图)
     */
    @Length(min = 0, max = 500, message = "图片(轮播图)长度为0-500个字符")
    @ApiModelProperty(value = "图片(轮播图)", dataType = "String")
    private String images;

    /**
     * 事件/活动类型(1举行活动,2公告,3政策)id
     */
    @NotNull(message = "事件/活动类型不能为空")
    @Min(value = 1,message = "事件/活动类型不能为空")
    @ApiModelProperty(value = "事件/活动类型(1举行活动,2公告,3政策)id", dataType = "int")
    private int type;

    /**
     * 排序
     */
    @Min(value = 0, message = "排序权重最小为0")
    @Max(value = 9999, message = "排序权重最大为9999")
    @ApiModelProperty(value = "排序", dataType = "int")
    private int sort;

    /**
     * 活动开始时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm", timezone = "GMT+8")
    @ApiModelProperty(value = "活动开始时间(yyyy-MM-dd HH:mm)", dataType = "Date")
    private Date startTime;

    /**
     * 活动结束时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm", timezone = "GMT+8")
    @ApiModelProperty(value = "活动结束时间(yyyy-MM-dd HH:mm)", dataType = "Date")
    private Date endTime;


}
